public class Main {
    public static void main(String[] args) {
        // ========== 1. 创建课程 ==========
        Course javaCourse = new Course("C001", "Java程序设计", "教学楼A101", "周一上午1-2节");
        Course dsCourse = new Course("C002", "数据结构", "教学楼B202", "周三下午3-4节");

        // ========== 2. 创建教师并「开课」 ==========
        Teacher zhangTeacher = new Teacher("T001", "张老师", "男");
        Teacher liTeacher = new Teacher("T002", "李老师", "女");

        zhangTeacher.openCourse(javaCourse); // 张老师讲授Java课
        liTeacher.openCourse(dsCourse);     // 李老师讲授数据结构课

        System.out.println("教师" + zhangTeacher.getName() + "的授课课程：" + zhangTeacher.getTaughtCourse());
        System.out.println("教师" + liTeacher.getName() + "的授课课程：" + liTeacher.getTaughtCourse());

        // ========== 3. 创建学生并「选课/退课」 ==========
        Student xiaoMing = new Student("S001", "小明", "男");
        Student xiaoHong = new Student("S002", "小红", "女");

        xiaoMing.selectCourse(javaCourse); // 小明选Java课
        System.out.println("小明选课后：" + xiaoMing);

        xiaoHong.selectCourse(dsCourse);   // 小红选数据结构课
        System.out.println("小红选课后：" + xiaoHong);

        xiaoMing.dropCourse(); // 小明退课
        System.out.println("小明退课后：" + xiaoMing);

        // ========== 4. 打印学生课表 ==========
        xiaoMing.printCourseSchedule();
        xiaoHong.printCourseSchedule();
    }
}